<!DOCTYPE html>
<body>
<script src="../../../resources/js-test.js"></script>
<script src="../resources/common.js"></script>
<script src="../resources/multiple-fields-value-set-empty.js"></script>
<script>
testSettingEmptyStringClearsSubFields('time');

debug('');
input = document.createElement('input');
input.type = 'time';
input.min = '11:23:45';
input.step = '60';
// Because the step value is 60 seconds, the seconds fields is read-only.
document.body.appendChild(input);
debug('Initial text: ' + getUserAgentShadowTextContent(input));
debug('Empty value should not clear read-only fields.');
shouldBeEqualToString('input.value = ""; getUserAgentShadowTextContent(input)', '--:--:45 --');

debug('Empty value should clear only editable fields.');
input.focus();
shouldBeEqualToString('eventSender.keyDown("ArrowUp"); getUserAgentShadowTextContent(input)', '01:--:45 --');
shouldBeEqualToString('input.value = ""; getUserAgentShadowTextContent(input)', '--:--:45 --');

</script>
</body>
